Overview
Create a batch whenever you want to stage a new outbound campaign. The batch groups a friendly batchName with one or more provisioned calling numbers so you can add contacts and start dialing later. The response returns the batchId, which is required by every follow-up batch operation.
Prerequisites
API key with Calling Management scope, OR Bearer token for authenticated workspace access
At least one outbound phone number is active on the workspace
The calling numbers you pass belong to the same workspace
Request
Workspace API key. Find it under Settings → API access . Either x-api-key or Authorization header is required.
Bearer token for authenticated workspace access. Either x-api-key or Authorization header is required.
Human readable campaign name shown in the Nexus dashboard.
Array of phone IDs that the dialer can rotate through while placing calls from this batch.
Number of retry attempts for failed calls.
Delay in seconds between retry attempts.
Timezone for the batch (e.g., “America/New_York”, “Asia/Kolkata”). Used for scheduling calls.
Object defining calling hours. Example: {"start": "09:00", "end": "17:00"}.
Array of allowed days for calling (0=Sunday, 1=Monday, …, 6=Saturday). Example: [1,2,3,4,5] for weekdays.
# Using API Key
curl --location '{{baseUrl}}/api/call/createBatch' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"batchName": "API Campaign May 2025",
"callingNumbers": ["64e5f12345abcdef87654321"],
"retry": 3,
"delay": 60,
"timezone": "America/New_York",
"callingHour": {"start": "09:00", "end": "17:00"},
"allowedDays": [1,2,3,4,5]
}'
Response
{
"message" : "Batch created successfully" ,
"status" : true ,
"code" : 201 ,
"errorMessage" : "" ,
"data" : "64e5f12345abcdef98765432"
}
Indicates whether the batch record was stored successfully.
HTTP status code (201 for successful creation).
Batch ID (string) to use when adding calls, starting the dialer, or updating batch metadata.
Human readable confirmation message.
Error Handling
400 Bad Request – Missing batchName, missing or empty callingNumbers array, or invalid input format.
403 Forbidden – Invalid or missing API key, API key doesn’t match workspace, or no user found (when using Bearer token).
500 Internal Server Error – Failed to create batch in database; retry or contact support with the request ID.
Authentication Options: You can authenticate using either:
API Key: Pass x-api-key header with your workspace API key
Bearer Token: Pass Authorization: Bearer <token> header
The system automatically determines the user from either authentication method. If both are provided, the API key takes precedence.
Use GET /api/call/batches/{userId} right after creation to verify that the new batch appears with the expected metadata.
Authorizations bearerAuth apiKeyAuth bearerAuth apiKeyAuth
Bearer token authentication for workspace access
Example: [ "64e5f12345abcdef87654321" ] Example: { "start" : "09:00" , "end" : "17:00" } Batch created successfully